using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using CodeSaude.Domain.Entities;

namespace CodeSaude.Infrastructure.Data.EntityConfig
{
    public class AlergiaMap : EntityTypeConfiguration<Alergia>
    {
        public AlergiaMap()
        {
            // Primary Key
            HasKey(t => t.AlergiaId);

            //// Properties
            //Property(t => t.AlergiaId)
            //    .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            Property(t => t.NomeAlergia)
                .IsRequired()
                .HasMaxLength(90);

            // Table & Column Mappings
            ToTable("alergia");
            Property(t => t.AlergiaId).HasColumnName("id_alergia");
            Property(t => t.NomeAlergia).HasColumnName("nome_alergia");
            Property(t => t.IdSituacao).HasColumnName("id_situacao");
        }
    }
}
